package DyingBaby.backend.common;

/**
 * 查询结果的数据封装类
 */

import java.util.List;
import java.util.Map;

public class QueryResult {
    public final Object data;
    public final long elapsedMillis;
    public final String planType;

    public QueryResult(Object data, long elapsedMillis, String planType) {
        this.data = data;
        this.elapsedMillis = elapsedMillis;
        this.planType = planType;
    }

    @SuppressWarnings("unchecked")
    public List<Map<String,Object>> asRowsOrNull() {
        if (data instanceof List) return (List<Map<String,Object>>) data;
        return null;
    }
}


